-- @owner: lvlintao
-- @date: 2025-4-10
-- @testpoint:D兼容性-中括号[]包裹标识符，function名使用中括号包裹标识符，成功

--step1.新建function使用中括号包裹标识符;expect:成功
@connect PrimaryDbDmode;
set d_format_behavior_compat_options='enable_sbr_identifier';
drop function if exists [Abc_abc];
drop function if exists [_123];
drop function if exists [!@#$%^_];
drop function if exists [[[];
drop function if exists [  _];
drop function if exists [''];
drop function if exists [""];

CREATE FUNCTION [Abc_abc] (in int, out f1 int, out f2 text)
    AS $$ SELECT $1, CAST($1 AS text) || ' is text' $$
    LANGUAGE SQL;
/

CREATE FUNCTION [_123] (in int, out f1 int, out f2 text)
    AS $$ SELECT $1, CAST($1 AS text) || ' is text' $$
    LANGUAGE SQL;
/

CREATE FUNCTION [!@#$%^_] (in int, out f1 int, out f2 text)
    AS $$ SELECT $1, CAST($1 AS text) || ' is text' $$
    LANGUAGE SQL;
/

CREATE FUNCTION [[[] (in int, out f1 int, out f2 text)
    AS $$ SELECT $1, CAST($1 AS text) || ' is text' $$
    LANGUAGE SQL;
/

CREATE FUNCTION [  _] (in int, out f1 int, out f2 text)
    AS $$ SELECT $1, CAST($1 AS text) || ' is text' $$
    LANGUAGE SQL;
/

CREATE FUNCTION [''] (in int, out f1 int, out f2 text)
    AS $$ SELECT $1, CAST($1 AS text) || ' is text' $$
    LANGUAGE SQL;
/

CREATE FUNCTION [""] (in int, out f1 int, out f2 text)
    AS $$ SELECT $1, CAST($1 AS text) || ' is text' $$
    LANGUAGE SQL;
/

--step2.清理环境;expect:成功
drop function if exists [Abc_abc];
drop function if exists [_123];
drop function if exists [!@#$%^_];
drop function if exists [[[];
drop function if exists [  _];
drop function if exists [''];
drop function if exists [""];


